<template>
    <div class="wrap normal">
        <!-- 搜索条件 -->
        <!-- <div class="wrap-form" id="wrap-form"></div> -->
        <!-- table数据 -->
        <div class="wrap-table">
            <el-table :data="tableData" :max-height="tableMaxHeight" border v-loading="tableLoading" :header-cell-style="{ background: '#F5F6FA' }">
                <el-table-column type="index" label="序号" width="50" align="center"> </el-table-column>
                <el-table-column label="承运品牌logo" min-width="80">
                    <template slot-scope="scope">
                        <el-image style="width: 50px; height: 50px; border-radius: 50%; cursor: pointer" :src="scope.row.carrierLogo" fit="fill" :preview-src-list="[scope.row.carrierLogo]"></el-image>
                    </template>
                </el-table-column>
                <el-table-column prop="carrierName" label="承运品牌名称" min-width="100"> </el-table-column>
                <el-table-column prop="carrierCode" label="承运品牌编码" min-width="100"></el-table-column>
                <el-table-column prop="officialCustomerMobile" label="官方客服电话" min-width="100"></el-table-column>
                <el-table-column prop="jumpOfficialCtmserviceParam" label="跳转官方小程序配置" min-width="120"></el-table-column>
            </el-table>
            <pagination :total="page.totalNum" :page.sync="page.pageNum" :limit.sync="page.pageSize" layout="total, sizes, prev, pager, next, jumper" @pagination="getTableData" />
        </div>
    </div>
</template>

<script>
import tableHeight from '@/mixins/tableHeight'
import { getCompanyList } from '@/api/config'
export default {
    name: 'ConfigCompany',
    mixins: [tableHeight],
    data() {
        return {
            form: {},
            page: {
                pageNum: 1,
                pageSize: 10,
                totalNum: 0
            },
            tableData: [],
            tableLoading: false,
            // 类型
            operateType: '',
            // 标题
            operateTitle: '',
            // 弹框
            operateDialog: false,
            // 宽度
            operateWidth: 550,
            // loading
            operateLoading: false,
            // 操作form
            operateForm: {

            },
            operateRules: {

            },
        };
    },
    methods: {
        // 数据
        getTableData() {
            this.tableLoading = true
            const data = {
                pageNum: this.page.pageNum,
                pageSize: this.page.pageSize,
                ...this.form
            }
            getCompanyList(data).then(res => {
                this.tableLoading = false
                this.tableData = res.data.records
                this.page.totalNum = res.data.total
            }).catch(error => {
                this.tableLoading = false
            })
        },
        // 操作
        pageOperate(type, row) {
            this.operateType = type
            switch (type) {
                case 'search':
                    this.getTableData()
                    break;
                case 'refresh':
                    Object.assign(this.$data, this.$options.data())
                    this.getTableData()
                    break;
                default:
                    break;
            }
        }
    },
    mounted() {
        this.getTableData()
    }
};
</script>

<style lang="scss" scoped>
</style>